﻿using System;
using System.Collections.Generic;
using System.Text;

using H2.NET.Data.Common;
using H2.NET.Data.Common.Mappings;
using H2.NET.Data.Common.Validates;

namespace H2.NET.Business
{
    [Table]
    [Serializable]
    public partial class t_Logging : DataObject
    {
        [ID]
        [DID]
        public string ID { get { return _ID; } set { _ID = value; EntityState.FieldChange("ID"); } }
        private string _ID;
        public static FieldInfo id = new FieldInfo("t_Logging", "ID");

        //日志#
        [Column]
        public string LogNo { get { return _LogNo; } set { _LogNo = value; EntityState.FieldChange("LogNo"); } }
        private string _LogNo;
        public static FieldInfo logNo = new FieldInfo("t_Logging", "LogNo");

        //日志类别
        [Column]
        [EnumToInt]
        public LogType LogType { get { return _LogType; } set { _LogType = value; EntityState.FieldChange("LogType"); } }
        private LogType _LogType;
        public static FieldInfo logType = new FieldInfo("t_Logging", "LogType");

        //所属模块
        [Column]
        [EnumToInt]
        public LogCategory LogCategory { get { return _LogCategory; } set { _LogCategory = value; EntityState.FieldChange("LogCategory"); } }
        private LogCategory _LogCategory;
        public static FieldInfo logCategory = new FieldInfo("t_Logging", "LogCategory");

        //时间
        [Column]
        [NowDate]
        public DateTime Time { get { return _Time; } set { _Time = value; EntityState.FieldChange("Time"); } }
        private DateTime _Time;
        public static FieldInfo time = new FieldInfo("t_Logging", "Time");

        //流程名
        [Column]
        public string Process { get { return _Process; } set { _Process = value; EntityState.FieldChange("Process"); } }
        private string _Process;
        public static FieldInfo process = new FieldInfo("t_Logging", "Process");

        //实例号
        [Column]
        public int Incident { get { return _Incident; } set { _Incident = value; EntityState.FieldChange("Incident"); } }
        private int _Incident;
        public static FieldInfo incident = new FieldInfo("t_Logging", "Incident");

        //步骤名
        [Column]
        public string Step { get { return _Step; } set { _Step = value; EntityState.FieldChange("Step"); } }
        private string _Step;
        public static FieldInfo step = new FieldInfo("t_Logging", "Step");

        //信息
        [Column]
        public string Message { get { return _Message; } set { _Message = value; EntityState.FieldChange("Message"); } }
        private string _Message;
        public static FieldInfo message = new FieldInfo("t_Logging", "Message");
    }

    public enum LogCategory
    {
        Login,
        Engine,
        Database
    }

    public enum LogType
    {
        Debug,
        Trace,
        Infomations,
        Warning,
        Error,
        Fatal
    }
}
